# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=magescan
pkgver=1.12.9
pkgrel=1
pkgdesc='Scan a Magento site for information.'
groups=('blackarch' 'blackarch-webapp' 'blackarch-scanner')
arch=('any')
url='https://github.com/steverobbins/magescan'
license=('custom:unknown')
depends=('php')
makedepends=('git')
source=("https://github.com/steverobbins/$pkgname/releases/download/v$pkgver/$pkgname.phar")
sha512sums=('0239840c8d8b6abf221a746d230af136a1ee5dfe405076890112d765c55f77155b46d8ae40e3531dc583c531854d21bea93377e32528659f0e95fc3809439db9')

package() {
  install -dm 755 "$pkgdir/usr/bin"

  install -Dm 644 "$pkgname.phar" "$pkgdir/usr/share/$pkgname/$pkgname.phar"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
exec php /usr/share/$pkgname/$pkgname.phar "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

